import request from '@/utils/request_zc'

export function getSaleOrderApproveList ({
  orderNo,
  customerName,
  deliverStartDate,
  deliverEndDate,
  applyStatus,
  applyUser,
  applyStartTime,
  applyEndTime,
  approveUser,
  approveStartTime,
  approveStatus,
  approveEndTime }) {
  return request({
    url: '/sales/order/list',
    method: 'get',
    params: {
      orderNo,
      customerName,
      deliveryStartDate: deliverStartDate,
      deliveryEndDate: deliverEndDate,
      applyStatus,
      applyUser,
      applyStartTime,
      applyEndTime,
      approveUser,
      approveStartTime,
      approveStatus,
      approveEndTime
    }
  })
}

export function SaleOrderApprove ({ approveStatus, id, approveAdvice }) {
  return request({
    url: '/sales/order/approve',
    method: 'post',
    data: {
      approveStatus,
      id,
      approveAdvice
    }
  })
}

export function getApplyApproveUserList () {
  return request({
    url: '/user/list',
    method: 'get'
  })
}

export function getCustomerList () {
  return request({
    url: '/customer/list',
    method: 'get',
    params: {
      limit: 999
    }
  })
}
